/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.app.dto.UserInfoDto;
import com.yami.shop.bean.model.UserExtension;
import com.yami.shop.bean.param.CustomerReqParam;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 用户扩展信息
 *
 * @author LGH
 * @date 2020-02-26 16:03:14
 */
public interface UserExtensionMapper extends BaseMapper<UserExtension> {

    void updateByVersion(@Param("userExtension") UserExtension userExtension);

    Page<UserExtension> getPage(PageParam<UserExtension> page, @Param("userExtension") UserExtension userExtension);

    void setUserLevelBylevelId(@Param("level") Integer level, @Param("levelType") Integer levelType);

    void serMaxUserLavelByLevelId(@Param("level") Integer level, @Param("minNeedGrowth") Integer minNeedGrowth, @Param("maxNeedGrowth") Integer maxNeedGrowth, @Param("levelType") Integer levelType);

    void updateBatchByUserId(@Param("userExtensions") List<UserExtension> userExtensions);

    Integer countMemberByParam(@Param("param") CustomerReqParam param);

    Integer countPayMemberByParam(@Param("param") CustomerReqParam param);

    Integer countAllPersonNum(@Param("date") Date date, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("isMember") Integer isMember);

    Integer countVisitMemberNum(@Param("dateTime") Date dateTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    Integer countAddCartMemberNum(@Param("dateTime") Date dateTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    Integer countVisitMemberNumByFlowLog(@Param("dateTime") Date dateTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    void updateBalanceByVersion(@Param("userExtension") UserExtension userExtension);

    UserInfoDto getUserInfo(@Param("userId") String userId);

    UserExtension getByUserId(@Param("userId") String userId);

}
